package service;

import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.ccc.model.Manager;
import com.ccc.service.ManagerService;


public class ManagerServiceTest {
	
	private static ManagerService managerService;
	
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		try {
			ApplicationContext cxt = new ClassPathXmlApplicationContext("beans.xml");
			managerService = (ManagerService)cxt.getBean("managerService");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	@Test
	public void checkingTest(){
		Manager manager = new Manager();
		manager.setManagerId(1);
		manager.setManager("gg");
		manager.setManagerPass("ggg");
		System.out.print(managerService.checking(manager));
	}
	
	@Test
	public void showManagerTest(){
		System.out.println(managerService.showManager());
	}

}
